﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NumericalMethod
{
    class PhysConst
    {
        List<string> m_strPhysConst = new List<string>();
        public PhysConst()
        {
            // 13 Zeichen
            m_strPhysConst.Add(("")); // soll bei 1 anfangen
            m_strPhysConst.Add(("_LAMBDA_BAR_e"));
            m_strPhysConst.Add(("_SIGMA_0_BARN"));
            m_strPhysConst.Add(("_SIN2HETA_W"));

            // 11 Zeichen
            m_strPhysConst.Add(("_h_BAR_MeVs"));
            m_strPhysConst.Add(("_MU_B_MeV"));
            m_strPhysConst.Add(("_LAMBDA_1EV"));
            m_strPhysConst.Add(("_MU_N_MeV"));

            // 10 Zeichen

            // 9 Zeichen
            m_strPhysConst.Add(("_R_INF_EV"));
            m_strPhysConst.Add(("_SIGMA_SB"));

            // 8 Zeichen
            m_strPhysConst.Add(("_LAMBDAT"));
            m_strPhysConst.Add(("_m_D_MeV"));
            m_strPhysConst.Add(("_m_e_MeV"));
            m_strPhysConst.Add(("_m_P_MeV"));
            m_strPhysConst.Add(("_m_P_M_E"));
            m_strPhysConst.Add(("_V_MOLAR"));

            // 7 Zeichen
            m_strPhysConst.Add(("_hBARc2"));
            m_strPhysConst.Add(("_K_B_EV"));
            m_strPhysConst.Add(("_m_e_kg"));
            m_strPhysConst.Add(("_m_P_kg"));

            // 6 Zeichen
            m_strPhysConst.Add(("_Alpha"));
            m_strPhysConst.Add(("_EPS_0"));
            m_strPhysConst.Add(("_e_ESU"));
            m_strPhysConst.Add(("_E_M_e"));
            m_strPhysConst.Add(("_E_M_P"));
            m_strPhysConst.Add(("_h_BAR"));
            m_strPhysConst.Add(("_hBARc"));
            m_strPhysConst.Add(("_m_P_u"));
            m_strPhysConst.Add(("_u_MeV"));

            // 5 Zeichen
            m_strPhysConst.Add(("_G_SI"));
            m_strPhysConst.Add(("_M_Z0"));
            m_strPhysConst.Add(("_MU_0"));
            m_strPhysConst.Add(("_u_kg"));

            // 4 Zeichen
            m_strPhysConst.Add(("_a_0"));
            m_strPhysConst.Add(("_e_C"));
            m_strPhysConst.Add(("_G_F"));
            m_strPhysConst.Add(("_G_P"));
            m_strPhysConst.Add(("_G_S"));
            m_strPhysConst.Add(("_K_B"));
            m_strPhysConst.Add(("_M_W"));
            m_strPhysConst.Add(("_N_A"));
            m_strPhysConst.Add(("_r_e"));

            //2 Zeichen
            m_strPhysConst.Add(("_c"));
            m_strPhysConst.Add(("_h"));
            m_strPhysConst.Add(("_g"));

            m_strPhysConst.Add(("***"));

        }
        public string GetEachPhysConst(int i) //Reihenfolge muß von längstem zu kürzerem
        {
            return m_strPhysConst[i];
        }
        public bool IsPhysConst(string str)
        {
            if (str.Equals("_c")) return true;
            if (str.Equals("_h")) return true;
            if (str.Equals("_h_BAR")) return true;
            if (str.Equals("_h_BAR_MeVs")) return true;
            if (str.Equals("_e_C")) return true;
            if (str.Equals("_e_ESU")) return true;
            if (str.Equals("_hBARc")) return true;
            if (str.Equals("_hBARc2")) return true;
            if (str.Equals("_m_e_kg")) return true;
            if (str.Equals("_m_e_MeV")) return true;
            if (str.Equals("_m_P_MeV")) return true;
            if (str.Equals("_m_P_u")) return true;
            if (str.Equals("_m_P_kg")) return true;
            if (str.Equals("_m_P_M_E")) return true;
            if (str.Equals("_m_D_MeV")) return true;
            if (str.Equals("_u_MeV")) return true;
            if (str.Equals("_u_kg")) return true;
            if (str.Equals("_EPS_0")) return true;
            if (str.Equals("_MU_0")) return true;
            if (str.Equals("_Alpha")) return true;
            if (str.Equals("_r_e")) return true;
            if (str.Equals("_LAMBDA_BAR_e")) return true;
            if (str.Equals("_a_0")) return true;
            if (str.Equals("_LAMBDA_1EV")) return true;
            if (str.Equals("_R_INF_EV")) return true;
            if (str.Equals("_SIGMA_0_BARN")) return true;
            if (str.Equals("_MU_B_MeV")) return true;
            if (str.Equals("_MU_N_MeV")) return true;
            if (str.Equals("_E_M_e")) return true;
            if (str.Equals("_E_M_P")) return true;
            if (str.Equals("_G_SI")) return true;
            if (str.Equals("_G_P")) return true;
            if (str.Equals("_g")) return true;
            if (str.Equals("_N_A")) return true;
            if (str.Equals("_K_B")) return true;
            if (str.Equals("_K_B_EV")) return true;
            if (str.Equals("_V_MOLAR")) return true;
            if (str.Equals("_LAMBDAT")) return true;
            if (str.Equals("_SIGMA_SB")) return true;
            if (str.Equals("_G_F")) return true;
            if (str.Equals("_SIN2HETA_W")) return true;
            if (str.Equals("_M_W")) return true;
            if (str.Equals("_M_Z0")) return true;
            if (str.Equals("_G_S")) return true;

            return false;
        }

        public double GetPhysConstValue(string str)
        {
            if (str.Equals("_c")) return _c;
            if (str.Equals("_h")) return _h;
            if (str.Equals("_h_BAR")) return _h_BAR;
            if (str.Equals("_h_BAR_MeVs")) return _h_BAR_MeVs;
            if (str.Equals("_e_C")) return _e_C;
            if (str.Equals("_e_ESU")) return _e_ESU;
            if (str.Equals("_hBARc")) return _hBARc;
            if (str.Equals("_hBARc2")) return _hBARc2;
            if (str.Equals("_m_e_kg")) return _m_e_kg;
            if (str.Equals("_m_e_MeV")) return _m_e_MeV;
            if (str.Equals("_m_P_MeV")) return _m_P_MeV;
            if (str.Equals("_m_P_u")) return _m_P_u;
            if (str.Equals("_m_P_kg")) return _m_P_kg;
            if (str.Equals("_m_P_M_E")) return _m_P_M_E;
            if (str.Equals("_m_D_MeV")) return _m_D_MeV;
            if (str.Equals("_u_MeV")) return _u_MeV;
            if (str.Equals("_u_kg")) return _u_kg;
            if (str.Equals("_EPS_0")) return _EPS_0;
            if (str.Equals("_MU_0")) return _MU_0;
            if (str.Equals("_Alpha")) return _ALPHA;
            if (str.Equals("_r_e")) return _r_e;
            if (str.Equals("_LAMBDA_BAR_e")) return _LAMBDA_BAR_e;
            if (str.Equals("_a_0")) return _a_0;
            if (str.Equals("_LAMBDA_1EV")) return _LAMBDA_1EV;
            if (str.Equals("_R_INF_EV")) return _R_INF_EV;
            if (str.Equals("_SIGMA_0_BARN")) return _SIGMA_0_BARN;
            if (str.Equals("_MU_B_MeV")) return _MU_B_MeV;
            if (str.Equals("_MU_N_MeV")) return _MU_N_MeV;
            if (str.Equals("_E_M_e")) return _E_M_e;
            if (str.Equals("_E_M_P")) return _E_M_P;
            if (str.Equals("_G_SI")) return _G_SI;
            if (str.Equals("_G_P")) return _G_P;
            if (str.Equals("_g")) return _g;
            if (str.Equals("_N_A")) return _N_A;
            if (str.Equals("_K_B")) return _K_B;
            if (str.Equals("_K_B_EV")) return _K_B_EV;
            if (str.Equals("_V_MOLAR")) return _V_MOLAR;
            if (str.Equals("_LAMBDAT")) return _LAMBDAT;
            if (str.Equals("_SIGMA_SB")) return _SIGMA_SB;
            if (str.Equals("_G_F")) return _G_F;
            if (str.Equals("_SIN2HETA_W")) return _SIN2HETA_W;
            if (str.Equals("_M_W")) return _M_W;
            if (str.Equals("_M_Z0")) return _M_Z0;
            if (str.Equals("_G_S")) return _G_S;

            return 0.0;
        }
        // Velocity of light in vacuum (def) m/s                
        const double _c = 2.99792458E8;

        // Planck constant (40)J s                 
        const double _h = 6.6260755E-34;

        // Planck constant, reduced (63) J s       
        const double _h_BAR = 1.05457266E-34;

        // Planck constant, reduced (20) MeV s       
        const double _h_BAR_MeVs = 6.5821220E-22;

        // electron charge magnitude (49) C      
        const double _e_C = 1.60217733E-19;

        // electron charge magnitude (15) esu      
        const double _e_ESU = 4.8032068E-10;

        // conversion constant hbar*c (59) MeV Fm            
        const double _hBARc = 197.327053;

        // conversion constant (hbar*c)^2 (23) GeV^2 mbarn            
        const double _hBARc2 = 0.38937966;

        // electron mass (54) kg                  
        const double _m_e_kg = 9.1093897E-31;

        // electron mass (15) MeV/c^2                   
        const double _m_e_MeV = 0.51099906;

        // proton mass (28) MeV/c^2                     
        const double _m_P_MeV = 938.27231;

        // proton mass (12) u                    
        const double _m_P_u = 1.007276470;

        // proton mass (10) kg                    
        const double _m_P_kg = 1.6726231E-27;

        // proton mass (37) m_e                    
        const double _m_P_M_E = 1836.152701;

        // deuteron mass (57) MeV/c^2                  
        const double _m_D_MeV = 1875.61339;

        // unified atomic mass unit (u) (28) MeV/c^2   
        const double _u_MeV = 931.49432;

        // unified atomic mass unit (u) (10) kg   
        const double _u_kg = 1.6605402E-27;

        // permittivity of free space F/m      
        const double _EPS_0 = 8.854187817E-12;

        // permeability of free space N/A^2      
        const double _MU_0 = 12.566370614E-7;

        // fine-structure constant (61)        
        const double _ALPHA = 1 / 137.0359895;

        // classical electron radius (38) m     
        const double _r_e = 2.81794092E-15;

        // electron Compton wavelength (35) m   
        const double _LAMBDA_BAR_e = 3.86159323E-13;

        // Bohr radius (mnucleus= infty) (24) m     
        const double _a_0 = 0.529177249E-10;

        // wavelength of 1 eV/c particle (37) m   
        const double _LAMBDA_1EV = 1.23984244E-6;

        // Rydberg energy (mnucleus = infinity) (40) eV                 
        const double _R_INF_EV = 13.6056981;

        // Thomson cross section (18) barn          
        const double _SIGMA_0_BARN = 0.66524616;

        // Bohr magneton (52)  MeV/T                 
        const double _MU_B_MeV = 5.78838263E-11;

        // nuclear magneton (28) MeV/T               
        const double _MU_N_MeV = 3.15245166E-14;

        // electron cyclotron freq./field (53) C/kg (rad/sT) 
        const double _E_M_e = 1.75881962E11;

        // proton cyclotron freq./field (29) C/kg (rad/sT) 
        const double _E_M_P = 9.5788309E7;

        // gravitational constant (85) m^3/kgs^2         
        const double _G_SI = 6.67259E-11;

        // gravitational constant (86) h_bar c (GeV/c^2)^{-2}       
        const double _G_P = 6.70711E-39;

        // standard grav. accel., sea level m/s^2 
        const double _g = 9.80665;

        // Avogadro constant (36)  /mole            
        const double _N_A = 6.0221367E23;

        // Boltzmann constant (12) J/K             
        const double _K_B = 1.380658E-23;

        // Boltzmann constant (73) eV/K            
        const double _K_B_EV = 8.617385E-5;

        // molar volume, ideal gas at STP (19) m^3/mole  
        const double _V_MOLAR = 22.41410E-3;

        // Wien displacement law constant (24) m K 
        const double _LAMBDAT = 2.897756E-3;

        // Stefan-Boltzmann constant (19) W/m^2K^4       
        const double _SIGMA_SB = 5.67051E-8;

        // Fermi coupling constant (2)  GeV^{-2}        
        const double _G_F = 1.16639E-5;

        // weak mixing angle  (5)  at M_Z           
        const double _SIN2HETA_W = 0.23192;

        // W boson mass (26) GeV/c^2                  
        const double _M_W = 80.22;

        // Z_0 boson mass (7) GeV/c^2                  
        const double _M_Z0 = 91.187;

        // strong coupling constant (5))  at M_Z     
        const double _G_S = 0.117;

    }

}
